import { StringifyOptions } from "querystring"

export interface ResponseData {
  code: number
  message: string
  ok: boolean
}

export interface ResponseSpuAttrData extends ResponseData {
  data: SpuAttrs
}

export interface ResponseSpuData extends ResponseData {
  data: {
    records: Records
    total: number
    size: number
    current: number
    orders: []
    optimizeCountSql: boolean
    hitCount: boolean
    countId: null
    maxLimit: null
    searchCount: boolean
    pages: number
  }
}

export type Records = SpuData[]

export interface SpuData {
  id?: number | string
  spuName: string
  description: string
  category3Id: number | string
  tmId: number | string

  spuSaleAttrList: ProductAttrs
  spuImageList: Imgs
}

export type Imgs = SpuImgData[]
export type ProductAttrs = ProductData[]

export interface SpuImgData {
  createTime: string
  id?: number | string
  imgName: string
  imgUrl: string
  spuId: number | StringifyOptions
  updateTime: string
}
export type SpuAttrs = SpuAttrData[]

export type SpuProducts = TrademarkData[]

export interface SpuAttrData {
  createTime: string
  id?: number | string
  name: string
  updateTime: string
}

export interface TrademarkData {
  id?: number
  tmName: string
  logoUrl: string
}

export interface AllTrademark extends ResponseData {
  data: TrademarkData[]
}

export interface ProductData {
  id?: number | string
  createTime?: string
  updateTime?: string
  spuId?: number | string
  baseSaleAttrId: number | string
  saleAttrName: string
  spuSaleAttrValueList: spuSaleAttrList
}

export interface ProductAttrValueData {
  id?: number | string
  createTime?: string
  updateTime?: string
  spuId?: number | string
  baseSaleAttrId: number | string
  saleAttrValueName: string
  saleAttrName?: string
  isChecked?: string
}

export type spuSaleAttrList = ProductAttrValueData[]
